/**
 * 
 */
package com.kelaite.procurement.utils;

import org.apache.commons.lang3.RandomStringUtils;

import com.kelaite.procurement.constants.BizType;
import com.kelaite.procurement.exception.BusinessException;

/**
 * @author think
 *
 */
public class CommonUtils {

	/**
	 * 
	 * @param bizType
	 *            必填字段，如：销售订单，则bizType可是是SO,如采购订单，则bizType可以是PO
	 * @return
	 */
	public static String generateBizNo(BizType bizType) {
		if (null == bizType) {
			throw new BusinessException("bizType can not be null. ");
		}
		return ConvertTime.getTimeFile() + bizType.getCode()
				+ RandomStringUtils.randomNumeric(5);
	}

	public static void main(String[] args) {
		System.out.println(ConvertTime.getTimeFile() + "PO"
				+ RandomStringUtils.randomNumeric(5));
	}
}
